<template>
	<el-dialog title="系统变量" v-model="visible" :width="700" append-to-body destroy-on-close :close-on-click-modal="false" :before-close="closed">
		<el-scrollbar>
			<el-row>
				<el-col class="element-item" :span="12" v-for="(item,index) in variableList" :key="index">
					{{ item.label }} &nbsp;&nbsp; {{ item.value }}
				</el-col>
			</el-row>
		</el-scrollbar>
	</el-dialog>
</template>

<script>
	import { defineAsyncComponent } from 'vue';

	export default {
		name: "ForScript",
		props: {
			script: { type: Object, default: () => {} },
			variables: { type: Object, default: () => {} },
		},
		emits: ['success', 'closed'],
		data() {
			return {
                options:{
                    
                },
				visible: false,
				loading: false,
				variableList: [],
			}
		},
		created() {

		},
		methods: {
			// 显示脚本
			open(){
				// 加载系统常量
				this.variableList = this.variables;
				this.visible = true;
				return this
			},
			// 关闭脚本编辑
			closed(){
				this.visible = false;
				this.$emit('closed', false);
			},
		},
	}
</script>

<style lang="scss" scoped>
.element-item{
	height: 35px;
	line-height: 35px;
	font-size: 15px;
}
</style>